#pragma once

typedef enum utils_trying_functions_return_code {
    kUTILS_TRYING_FUNCTIONS_RETURN_CODE_OK,
    kUTILS_TRYING_FUNCTIONS_RETURN_CODE_FAILED
}TTRYING_FUNCTIONS_RETURN_CODE;

#define kIP_ADDRESS_STRING_MAX_LENGTH 16


#define min_in_two(a, b) ((a) < (b) ? (a) : (b))
#define min_in_three(a, b, c) (min_in_two(a, b) == a ? min_in_two(a, c) : min_in_two(b, c))

void stripNewlineCharacter(char *str);

void parseIPv4AddressToString(struct in_addr address, char *buffer);

int tryParsingIPStringToInternetAddress(char *ip_address_str, struct in_addr *internet_address);